﻿$(function () {
    //定义地图
    map = new BMap.Map("map-box", { enableMapClick: false });
    map.enableScrollWheelZoom();  //启用滚轮放大缩
    //右上角，仅包含平移和缩放按钮
    var top_right_navigation_zoom = new BMap.NavigationControl({ anchor: BMAP_ANCHOR_BOTTOM_RIGHT, type: BMAP_NAVIGATION_CONTROL_ZOOM });
    //添加默认缩放平移控件
    map.addControl(top_right_navigation_zoom);
    //绑定地理位置
    var point = new BMap.Point(114.885529, 31.650339);
    map.centerAndZoom(point, 13);

    //#region 添加点
    //鄂豫皖苏区首府革命博物馆
    var bwgPoint = new BMap.Point(114.884391, 31.62272);
    var bwgMarker = new BMap.Marker(bwgPoint);
    map.addOverlay(bwgMarker);
    var bwgLabel = new BMap.Label("鄂豫皖苏区首府革命博物馆", { offset: new BMap.Size(20, -10) });
    bwgMarker.setLabel(bwgLabel);
    bwgMarker.addEventListener("click", bwgFunc);
    bwgLabel.addEventListener("click", bwgFunc);
    //大别山干部学院-体验中心
    var dbsPoint = new BMap.Point(114.889735, 31.687489);
    var dbsMarker = new BMap.Marker(dbsPoint);
    map.addOverlay(dbsMarker);
    var dbsLabel = new BMap.Label("大别山干部学院-体验中心", { offset: new BMap.Size(20, -10) });
    dbsMarker.setLabel(dbsLabel);
    dbsMarker.addEventListener("click", dbsFunc);
    dbsLabel.addEventListener("click", dbsFunc);
    //#endregion

    //事件
    function bwgFunc() {
        window.location.href = "Musemu/index.html";
    }

    function dbsFunc() {
        window.location.href = "DaBieShan/index.html";
    }
})